<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="mfuny.ggongal.admin.http.HttpPv" %>
<%@ page import="mfuny.ggongal.admin.debug.Debug" %>
<%@ page import="mfuny.ggongal.admin.http.HttpPvDecoder" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%
request.setCharacterEncoding( "utf-8" );
response.setContentType( "text/html; charset=utf-8" );
HttpPv httpPv = new HttpPv();
HttpPvDecoder decoder = new HttpPvDecoder();

String ggongal = request.getParameter("ggongal");
if( ggongal != null ) {
	try {
		String result = decoder.receiveDecode(ggongal);
		out.print(result);
	} catch ( Exception e ) {
		Debug.toDebugFile(e, "ggongal");
	}
	return;
}

String tag = request.getParameter( "tag" );

//pv 추가.
if ( tag.equals( "pv_add" )) {
	try{
		int ad_no = Integer.parseInt( request.getParameter( "ad_no" ) );
		String pvType = request.getParameter( "pv" );
		int result = httpPv.pv_add( ad_no, pvType );
		out.print( result );
	}catch(Exception e){
		Debug.toDebugFile(e, tag);
	}
}
//pv time 추가.
else if ( tag.equals( "pv_ggongAdd" )) {
	try{
		int ad_no = Integer.parseInt( request.getParameter( "ad_no" ) );
		int result = httpPv.pv_ggongAdd( ad_no );
		out.print( result );
	}catch(Exception e){
		Debug.toDebugFile(e, tag);
	}
}
%>